<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLogUserRetainedTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('log_user_retaineds', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('account_id')->comment('账号id');
            $table->string('account')->comment('账号');
            $table->string('login_time')->comment('登录时间');
            $table->date('date_time')->comment('日期');
            $table->timestamps();
            $table->softDeletes();
            $table->unique(['account_id', 'date_time']);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('log_user_retaineds');
    }
}
